package com.kuang.Dao;

import com.kuang.pojo.User;
import org.apache.ibatis.annotations.*;

import java.util.List;
import java.util.Map;

public interface UserMapper {

    @Select("select * from user")
    List<User> getUsers();


    //@Param("id") 当方法有多个参数的时候，每个参数使用@Param来区分
    @Select("select * from user where id = #{id} ")
    User getUserById(@Param("id") int id);


    @Insert("insert into user(id,name,pwd) values(#{id},#{name},#{password})")
    int addUser(User user);

    @Update("update user set name=#{},pwd=#{password} where id=#{id}")
    int updateUser(User user);

    @Delete("delete from user where id = #{id}")
    int deleteUser(int id);
}
